﻿<phone:PhoneApplicationPage
    x:Class="QuickWeb.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:QuickWeb;assembly=QuickWeb"
    mc:Ignorable="d"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">


    <phone:PhoneApplicationPage.Resources>

        
        
        <DataTemplate x:Name="MyHeaderTemplate">
            <TextBlock Text="{Binding  }" 
                       Foreground="{StaticResource PhoneAccentBrush}"  
                       TextWrapping="Wrap" />
        </DataTemplate>
        
       

        <DataTemplate x:Key="MyTitleTemplate">
            <TextBlock 
                Text="{Binding}"
                TextWrapping="Wrap" 
                />
        </DataTemplate>

        

    </phone:PhoneApplicationPage.Resources>
    
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"  >
        <!--Background="Transparent"-->

        <Grid.Background>
            <ImageBrush ImageSource="/Assets/defaultWallpaper.jpg" Stretch="UniformToFill"/>
        </Grid.Background>
        
        <!--<Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>-->

        <ProgressBar 
            x:Name="progressBar" VerticalAlignment="Top"       
            Background="Transparent" 
        />
            
       

        <!--Pivot Control-->
        <phone:Pivot 
            
            x:Name="pivot"
            Title="{Binding Path=LocalizedResources.appTitle, Source={StaticResource LocalizedStrings}}" 
            SelectionChanged="Pivot_SelectionChanged" 
            
            TitleTemplate="{StaticResource MyTitleTemplate}" 
            Loaded="Pivot_Loaded" >
           

            <!--Quick search item-->
            <phone:PivotItem x:Name="searchPivot"  >
                <phone:PivotItem.Header >
                    <TextBlock 
                        Text="{Binding Path=LocalizedResources.quickSearch, Source={StaticResource LocalizedStrings}}" 
                                               
                        TextWrapping="Wrap"                        
                    />
                </phone:PivotItem.Header>
                
                <!--Double line list with text wrapping-->
                <Grid>
                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />                        
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <phone:WebBrowser x:Name="browser" LoadCompleted="browser_LoadCompleted" Grid.Row="0"  />
                    
                        
                    <TextBox 
                        x:Name="searchBox" 
                        Grid.Row="1" 
                        TextWrapping="Wrap" 
                        Text="{Binding Path=LocalizedResources.Search, Source={StaticResource LocalizedStrings}}" 
                        GotFocus="searchBox_GotFocus"
                        LostFocus="searchBox_LostFocus"
                        Foreground="Gray" InputScope="Search"                         
                        KeyDown="searchBox_KeyDown"
                    />
                    <!--<Button Grid.Row="2" HorizontalAlignment="Right">
                        <Grid>
                            <Grid.Background>
                                <ImageBrush ImageSource="/Assets/overflowdots_light.png"/>
                            </Grid.Background>
                        </Grid>
                    </Button>-->
                    
                </Grid>
                
            </phone:PivotItem>

            <!--Pivot item two-->
            <phone:PivotItem x:Name="readPivot">
                <phone:PivotItem.Header>
                    <TextBlock 
                        Text="{Binding Path=LocalizedResources.reader, Source={StaticResource LocalizedStrings}}" 
                        TextWrapping="Wrap"
                        
                    />
                </phone:PivotItem.Header>
                <!--Double line list no text wrapping-->

            </phone:PivotItem>

           

        </phone:Pivot>

        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" IsHitTestVisible="False" />-->
    </Grid>

</phone:PhoneApplicationPage>